import { createEventBus } from "xiao-you-bus"

interface instance {
  pause: Function
}
interface plyrInstance {
  index: number
  instance: instance
}
interface State {
  theme: string
  scrollTop: number
  currentPageNum: number
  title: string
  plyrInstanceArr: Array<plyrInstance>
  plyrIndex: number
  themeColor: string
}

const bus = createEventBus<State>({
  theme: "",
  themeColor: "",
  scrollTop: 0,
  currentPageNum: 0,
  title: "",
  plyrInstanceArr: [],
  plyrIndex: 0,
})

export default bus
